package game.net.client;

import game.net.server.Server;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class Client {
	Socket server;
	
	public Client(String address) throws UnknownHostException{
		this(address, Server.DEFAULT_PORT);
	}
	
	public Client(String address, int port) throws UnknownHostException{
		this(InetAddress.getByName(address), port);
	}
	
	public Client(InetAddress address){
		this(address, Server.DEFAULT_PORT);
	}
	
	public Client(InetAddress address, int port){
		try {
			server = new Socket(address, port);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public boolean isConnected() {
		return server.isConnected();
	}

}
